package com.itheima.health.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.itheima.health.mapper.MemberMapper;
import com.itheima.health.pojo.Member;
import com.itheima.health.service.MemberService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @description:
 * @author: YHL
 * @time: 2021/1/18 16:34
 */
@Service
@Transactional
public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> implements MemberService {

    @Override
    public Member findMemberByTelephone(String telephone) {

        return baseMapper.findMemberByTelephone(telephone);
    }

    @Override
    @LcnTransaction  //    事务发起者  起始方法上添加该注解
    public int saveMember(Member member) {
        save(member);
        return member.getId();
    }
}
